package com.dmall.opening.up.records.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public final class Lists {

    public static boolean isEmpty(List list) {
        return list == null || list.isEmpty();
    }

    public static boolean isNotEmpty(List list) {
        return !isEmpty(list);
    }

    @SafeVarargs
    public static <T> ArrayList<T> newArrayList(T... items) {
        return com.google.common.collect.Lists.newArrayList(items);
    }

    public static <T> ArrayList<T> newArrayList(Iterator<? extends T> elements) {
        return com.google.common.collect.Lists.newArrayList(elements);
    }

    public static <T> List<List<T>> partition(List<T> list, int size) {
        return com.google.common.collect.Lists.partition(list, size);
    }
}
